package cn.itcast.itcaststore.dao.Impl;

import cn.itcast.itcaststore.dao.OrderitemDao;
import cn.itcast.itcaststore.domain.Orderitem;
import cn.itcast.itcaststore.utils.JDBCUtils;
import org.springframework.jdbc.core.JdbcTemplate;

public class IOrderitemDao implements OrderitemDao {
    private     JdbcTemplate jdbcTemplate = new JdbcTemplate(JDBCUtils.getDataSource());

    @Override
    public void create(Orderitem orderitem) {
        String sql = "insert into orderitem values(?,?,?)";
        jdbcTemplate.update(sql,orderitem.getOrder_id(),orderitem.getProduct_id(),orderitem.getBuynum() );
    }
}
